<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="When a Patroni Cluster Is Restored to a Point in Time Using Log Copies, the Restoration Job Is Successfully Executed, but the Restored Data Is Inconsistent with the Data at the Point in Time">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="en-us_topic_0000002164763598.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="">
  <meta name="DC.Publisher" content="20250306">
  <meta name="prodname" content="csbs">
  <meta name="documenttype" content="usermanual">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="EN-US_TOPIC_0000002199970229">
  <meta name="DC.Language" content="en-us">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>When a Patroni Cluster Is Restored to a Point in Time Using Log Copies, the Restoration Job Is Successfully Executed, but the Restored Data Is Inconsistent with the Data at the Point in Time</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="EN-US_TOPIC_0000002199970229"></a><a name="EN-US_TOPIC_0000002199970229"></a>
  <h1 class="topictitle1">When a Patroni Cluster Is Restored to a Point in Time Using Log Copies, the Restoration Job Is Successfully Executed, but the Restored Data Is Inconsistent with the Data at the Point in Time</h1>
  <div>
   <div class="section">
    <h4 class="sectiontitle">Symptom</h4>
    <p>When PostgreSQL databases of the Patroni cluster deployment type are restored to a specified point in time using log copies, the restoration job is successfully executed, but the restored data in the specified databases is inconsistent with the data at the specified point in time for restoration.</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">Possible Causes</h4>
    <p>Before restoring PostgreSQL databases of the Patroni cluster deployment type to a point in time using log copies, you need to configure the <strong>patroni.yml</strong> configuration file of the Patroni cluster in the target location for restoration in advance by referring to <a href="en-us_topic_0000002164763610.html#EN-US_TOPIC_0000002164763610__section721285884410">Prerequisites</a>. If the file is not configured or the configuration location is incorrect (for example, the configuration is not performed under <strong>bootstrap</strong> of the <strong>patroni.yml</strong> configuration file), data inconsistency occurs.</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">Troubleshooting</h4>
    <ol>
     <li><span>Use PuTTY to log in to the host where the PostgreSQL database is of the Patroni cluster deployment type.</span><p></p>
      <div class="note">
       <img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span>
       <div class="notebody">
        <p>The Patroni cluster consists of multiple nodes, and active/standby switchover can be performed for it. Therefore, you need to perform the following steps on all Patroni cluster nodes to ensure that no new problem occurs during restoration.</p>
       </div>
      </div> <p></p></li>
     <li><span>Configure the Patroni cluster configuration file <strong>patroni.yml</strong> in the target location for restoration by referring to <a href="en-us_topic_0000002164763610.html#EN-US_TOPIC_0000002164763610__section721285884410">Prerequisites</a>. The recommended configuration location is above <strong>initdb</strong> under <strong>bootstrap</strong> in the <strong>patroni.yml</strong> file, as shown in the red box of the following figure. Ensure that the indentation for <strong>method</strong> and <strong>initdb</strong> is the same. Do not add configurations under other items. Otherwise, the restoration job fails or data inconsistency occurs after the restoration job is successfully executed.</span><p></p><p>A configuration example is as follows:</p> <p><span><img src="en-us_image_0000002164763686.png"></span></p> <p></p></li>
     <li><span>After all nodes in the Patroni cluster are configured, perform point-in-time restoration using log copies again. The restoration job is successfully executed and data is successfully restored to the data at the specified point in time.</span></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>Parent topic:</strong> <a href="en-us_topic_0000002164763598.html">FAQs</a>
    </div>
   </div>
  </div>
 </body>
</html>